package main

import (
	"flag"
	"net/http"

	"log"
)

var (
	addr       = flag.String("addr", "127.0.0.1:80", "app addr")
	redisAddr  = flag.String("redisAddr", "127.0.0.1:6379", "redisAddr")
	redisType  = flag.String("redisType", "node", "redisType")
	avatarPath = flag.String("avatarPath", "/home/mckee/program/go/src/friendbot/avatars/", "avatarPath")
)

func init() {
	flag.Parse()
}

func main() {
	log.Println(*addr, *redisAddr, *redisType)

	saveAvatarPath = *avatarPath
	initRedis(*redisAddr, *redisType)

	http.HandleFunc("/", receiveMessage)
	log.Fatal(http.ListenAndServe(*addr, nil))
}
